/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hu
 * Date: 2024-05-01
 * Time: 22:28
 */
public class Tesy {
   /* public static int add(int x,int y){
        return x + y;
    }
    public static double add(double x,double y,double z){
        return x + y + z;
    }
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        double d = 10;
        double e = 20;
        double f = 30;
        int ret1= add(a,b);
        double ret2 = add(d,e,f);
        System.out.println(ret1);
        System.out.println(ret2);
    }*/
    //创建方法求两个数的最大值max2，随后再写一个求3个数的最大值的函数max3。
    //    要求：在max3这个函数中，调用max2函数，来实现3个数的最大值计算
    /*public static int max(int x,int y) {
        if (y > x) {
            int tmp = x;
            x = y;
            y = tmp;

        }
        return x;
    }
    public static int max(int x, int y, int z){
        if(y > x){
            max(x,y);
        }
        if(z > x){
            max(x,z);
        }

        return x;
    }

    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        int c = 30;
        int ret = max(a,b,c);
        System.out.println(ret);
    }*/
   public static void main(String[] args) {
       int a = 10;
       int b = 20;
       int c = 30;
       int ret = max3(a,b,c);
       System.out.println(ret);
   }
   public static int max3(int n1,int n2,int n3){
       int m1=max2(n1,n2);
       return max2(m1,n3);

   }

    private static int max2(int n1, int n2) {
        return n1>n2? n1:n2;
    }
}
